# 设置库文件名称
set(LIB_NAME sensor_noise)

# 收集所有源文件
file(GLOB_RECURSE SOURCES "*.cpp")
file(GLOB_RECURSE HEADERS "*.h")

# 创建库
add_library(${LIB_NAME}
  STATIC
  ${SOURCES}
  ${HEADERS})

# 设置包含目录
target_include_directories(${LIB_NAME}
  PUBLIC
  ${CMAKE_CURRENT_SOURCE_DIR}/..
  PRIVATE
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${ICEBasic_INCLUDE_DIRS}
)

target_link_libraries(${LIB_NAME}
  PUBLIC
  mujoco
)

# 设置生成位置无关代码
set_target_properties(${LIB_NAME} PROPERTIES
  POSITION_INDEPENDENT_CODE ON
)

# 导出库
install(TARGETS ${LIB_NAME}
  EXPORT utils-targets
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
  INCLUDES DESTINATION include
)

# 安装头文件
install(FILES ${HEADERS}
  DESTINATION include/${LIB_NAME}
)
